<template>
  <el-dialog
    v-model="visible"
    title="数据导入"
    width="40%"
    @close="handleClose"
  >
    <el-upload
      class="upload-demo"
      drag
      action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
      multiple
    >
      <el-icon style="font-size: 36px"><Upload /></el-icon>
      <div class="el-upload__text">点击或拖拽文件到此处上传</div>
      <div class="el-upload__text">支持xls，xlsx等类型的文件</div>
      <template #tip>
        <div class="el-upload__tip">
          <dl>
            <dt>上传的Excel表符合以下规范：</dt>
            <dd>· 文件大小不超过10M，且单个sheet页数据量不超过5000行</dd>
            <dd>· 仅支持（*.xls和*.xlsx）文件</dd>
            <dd>· 请确保您需要导入的sheet表头中不包含空的单元格，否则该sheet页数据系统将不做导入</dd>
            <dd>· 批量导入的数据不支持“内置变量”作为条件的过滤</dd>
            <dd>· 导入文件不支持Excel公式计算，如SUM，=H2*J2等</dd>
          </dl>
        </div>
      </template>
    </el-upload>
  </el-dialog>
</template>

<script setup>
import { ref, defineExpose } from "vue";
import { ElMessageBox } from "element-plus";
import { Plus } from "@element-plus/icons-vue";
import pinia from "@/store/pinia";
import { useStore } from "@/store/lowCode.js";
const lowCodeStore = useStore(pinia);

const visible = ref(false);

const handleClose = () => {
  visible.value = false;
};

defineExpose({
  visible
})
</script>

<style lang="less" scoped>
.dialog-footer button:first-child {
  margin-right: 10px;
}
.el-upload__tip dd {
  list-style-type: circle !important;
}
</style>